package cn.asterly.cicada.web.utils;

import org.apache.log4j.Logger;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Log4jtest {
    private static Logger logger =Logger.getRootLogger();

    public static  String  createDate(){
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyyMMdd HH:ss:mm");
        return simpleDateFormat.format(new Date());
    }

    public static void main(String[] args) {
        logger.info("********************************************************");
        for (int i = 0; i < 10000; i++) {

            logger.info(Log4jtest.createDate());

        }

        for (int i = 0; i < 10000; i++) {

            logger.debug(Log4jtest.createDate());

        }
        logger.debug("********************************************************");
        for (int i = 0; i < 10000; i++) {

            logger.error(Log4jtest.createDate());

        }
        logger.error("********************************************************");
        for (int i = 0; i < 10000; i++) {

            logger.fatal(Log4jtest.createDate());

        }
    }
}
